Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
@iiif/presentation-3
Advanced tools
A set of types that describe the format of the IIIF Presentation 3.0 specification as accurately as possible.
Installation:
$ npm i @iiif/presentation-3
Installation (yarn):
$ yarn add @iiif/presentation-3
Usage (Typescript):
import { Manifest } from '@iiif/presentation-3';
const manifest = getManifestFromSomewhere() as Manifest;
function doSomethingWithManifest(manifest: Manifest) {
// ...
}
Usage (Javascript):
/**
* @typedef { import("@iiif/presentation-3").Manifest } Manifest
*/
/**
* @type {Manifest}
*/
const manifest = {};
/**
* @param manifest {Manifest}
*/
function doSomethingWithManifest(manifest) {
console.log(manifest.label);
}
// You can also inline the import:
/**
* @type {import("@iiif/presentation-3").Manifest}
*/
const manifest2 = {};
This will enable types completions in VSCode and IDEA, along with inline documentation from the IIIF specification:
The following types are supported:
With some other types that aim to cover common services:
Type | Description |
---|---|
ResourceType | String literals for the possible values of type |
InternationalString | Common language property ({ "none": ["..."] } ) |
Reference | A reference to another resources ({id: '..', type: '..'} ) |
JsonLDContext | A partial of {'@context': ... } , extended by resources with contexts |
MetadataItem | Label value pair used in the metadata field |
SpecificationBehaviors | String literals for supported behaviors mentioned in the specification |
SpecificationTimeMode | String literals for supported time modes mentioned in the specification |
ViewingDirection | String literal for the 4 supported viewing directions |
Type | Description |
---|---|
Service | Any service that can appear in services property. Union of generic and specific services. |
Manifest | Types for a valid IIIF Manifest |
Canvas | Types for a valid IIIF Canvas |
ContentResource | Types for a Content Resource - warning this can be many things! |
AnnotationPage | Types for a valid Annotation page |
Annotation | Types for a valid Annotation in the context of a IIIF manifest |
AnnotationW3C | Types for a valid W3C annotation (different from above) |
Collection | Types for a valid IIIF Collection |
Range | Types for a valid IIIF Range |
AnnotationCollection | Types for a valid Annotation collection |
IIIFExternalWebResource | Abstract type for an external web resource |
ContentResourceString | Alias for string |
Type | Description |
---|---|
CanvasItems | Alias for Annotation Page |
CollectionItems | Union of Manifest or Collection |
ManifestItems | Alias for Canvas |
RangeItems | Union of Range, Canvas or string |
Type | Description |
---|---|
AuthAccessTokenServiceError | [todo] |
AuthAccessTokenServiceResponse | [todo] |
AuthAbstractService | [todo] |
AuthAccessTokenService | [todo] |
AuthExternalService | [todo] |
AuthClickThroughService | [todo] |
AuthKioskService | [todo] |
AuthLoginService | [todo] |
AuthLogoutService | [todo] |
AuthService | [todo] |
GeoJsonService | [todo] |
ImageService | [todo] |
ImageService2 | [todo] |
ImageServiceProfile | [todo] |
ImageProfile | [todo] |
ImageService3 | [todo] |
ImageSize | [todo] |
ImageTile | [todo] |
SearchService | [todo] |
SearchServiceAutocomplete | [todo] |
SearchServiceAutocompleteQueryParams | [todo] |
SearchServiceAutocompleteResponse | [todo] |
SearchServiceCommonHitSelectors | [todo] |
SearchServiceCommonResources | [todo] |
SearchServiceQueryParams | [todo] |
SearchServiceSearchCommonSelectors | [todo] |
SearchServiceSearchResponse | [todo] |
Most of these types are not exported, but internally follows the full W3C specification.
Type | Description |
---|---|
Agent | [todo] |
AnnotationBody | [todo] |
AnnotationTarget | [todo] |
AnyMotivation | [todo] |
Audience | [todo] |
Body | [todo] |
ChoiceBody | [todo] |
ChoiceTarget | [todo] |
Creator | [todo] |
BasicState | [todo] |
CssSelector | [todo] |
DataPositionSelector | [todo] |
FragmentSelector | [todo] |
Selector | [todo] |
RefinedBy | [todo] |
RefinedByState | [todo] |
EmbeddedResource | [todo] |
ExternalResourceTypes | [todo] |
ExternalWebResource | [todo] |
RangeSelector | [todo] |
RequestHeaderState | [todo] |
SpecificResource | [todo] |
State | [todo] |
SvgSelector | [todo] |
TextPositionSelector | [todo] |
TextQuoteSelector | [todo] |
TimeState | [todo] |
XPathSelector | [todo] |
Stylesheet | [todo] |
Target | [todo] |
TargetComposite | [todo] |
TargetList | [todo] |
TargetIndependents | [todo] |
W3CAnnotationBody | [todo] |
W3CAnnotationCollection | [todo] |
W3CAnnotationPage | [todo] |
W3CAnnotationTarget | [todo] |
W3CMotivation | [todo] |
LinkedResource | [todo] |
ResourceBaseProperties | [todo] |
OtherProperties | [todo] |
This is map of all the resources normalized where the following modifications are assumed to have been made:
The types do not have a tool to create these types, but may be useful for implementations.
Type | Description |
---|---|
DescriptiveNormalized | Normalized abstract with all descriptive properties |
LinkingNormalized | Normalized abstract with all linking properties |
StructuralNormalized | Normalized abstract with all structural properties |
OtherPropertiesNormalized | Misc properties on W3C Annotations normalized |
AnnotationW3cNormalised | Normalized W3C Annotation |
AnnotationCollectionNormalized | Normalized Annotation Collection |
AnnotationNormalized | Normalized Annotation as it appears in a IIIF Manifest |
AnnotationPageNormalized | Normalized Annotation Page |
CanvasNormalized | Normalized Canvas |
CollectionNormalized | Normalized Collection |
CreatorNormalized | Normalized Creator (from annotation) |
ManifestNormalized | Normalized Manifest |
RangeNormalized | Normalized Range |
ServiceNormalized | Normalized Service - note: normalizing services is not recommend |
These types are building blocks of other types.
Type | Description |
---|---|
LinkingProperties | The linking properties of IIIF in a map LinkingProperties['seeAlso'] |
DescriptiveProperties | The descriptive properties of IIIF in a map DescriptiveProperties['label'] |
TechnicalProperties | The technical properties of IIIF in a map DescriptiveProperties['id'] |
StructuralProperties | The structural properties of IIIF in a map DescriptiveProperties['annotations'] |
Type | Description |
---|---|
OmitProperties | Helper for removing properties from another type |
IdOrAtId | Helper for resources that can have either id or @id |
SomeRequired | Helper for requiring some properties from another type |
Required | Helper for requiring all properties from another type |
FAQs
IIIF Presentation v3.0 typescript types
The npm package @iiif/presentation-3 receives a total of 2,517 weekly downloads. As such, @iiif/presentation-3 popularity was classified as popular.
We found that @iiif/presentation-3 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.